import pandas as pd
import pymysql

## 加上字符集参数，防止中文乱码
dbconn=pymysql.connect(
  host="127.0.0.1",
  database="test02",
  user="root",
  password="password",
  port=3306,
  charset='utf8'
 )
sql = "select * from test02.test"
df_sql = pd.read_sql(sql,dbconn)
print(df_sql)